<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gb/cgb.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('cgb_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">cgb.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;types.h&gt;</code><br />
<code>#include &lt;<a class="el" href="stdint_8h_source.html">stdint.h</a>&gt;</code><br />
</div>
<p><a href="cgb_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a4a118ad3ee36468a3fa616977a64864e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(r,  g,  <a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>)&#160;&#160;&#160;((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)((((<a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>) &amp; 0x1f) &lt;&lt; 10) | ((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)(((g) &amp; 0x1f) &lt;&lt; 5)) | ((r) &amp; 0x1f)))</td></tr>
<tr class="separator:a4a118ad3ee36468a3fa616977a64864e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d2ed0f10b2b74123a544327bbfd7564"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a7d2ed0f10b2b74123a544327bbfd7564">RGB8</a>(r,  g,  <a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>)&#160;&#160;&#160;(((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)((((<a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 10)) | ((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)((((g) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 5)) | (((r) &gt;&gt; 3) &amp; 0x1f))</td></tr>
<tr class="separator:a7d2ed0f10b2b74123a544327bbfd7564"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5a6e450fcf10402278fe585a421dbbd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ab5a6e450fcf10402278fe585a421dbbd">RGBHTML</a>(RGB24bit)&#160;&#160;&#160;(<a class="el" href="nes_8h.html#a7d2ed0f10b2b74123a544327bbfd7564">RGB8</a>((((RGB24bit) &gt;&gt; 16) &amp; 0xff), (((RGB24bit) &gt;&gt; 8) &amp; 0xff), ((RGB24bit) &amp; 0xff)))</td></tr>
<tr class="separator:ab5a6e450fcf10402278fe585a421dbbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa039288455af8a3812a35aa1e7b903e4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#aa039288455af8a3812a35aa1e7b903e4">RGB_RED</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31,  0,  0)</td></tr>
<tr class="separator:aa039288455af8a3812a35aa1e7b903e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae29b6947ac7dca7db513e59f1cfcbf51"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ae29b6947ac7dca7db513e59f1cfcbf51">RGB_DARKRED</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(15,  0,  0)</td></tr>
<tr class="separator:ae29b6947ac7dca7db513e59f1cfcbf51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6c97468034c02fe204fd37036d9be15"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ab6c97468034c02fe204fd37036d9be15">RGB_GREEN</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0, 31,  0)</td></tr>
<tr class="separator:ab6c97468034c02fe204fd37036d9be15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ee7a5d8fd635e9132a2820a60f9789d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a1ee7a5d8fd635e9132a2820a60f9789d">RGB_DARKGREEN</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0, 15,  0)</td></tr>
<tr class="separator:a1ee7a5d8fd635e9132a2820a60f9789d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0eff802f1ca228046476209dc01c76ad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a0eff802f1ca228046476209dc01c76ad">RGB_BLUE</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0,  0, 31)</td></tr>
<tr class="separator:a0eff802f1ca228046476209dc01c76ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad44385fc245bbabf6da787dcc8930385"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ad44385fc245bbabf6da787dcc8930385">RGB_DARKBLUE</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0,  0, 15)</td></tr>
<tr class="separator:ad44385fc245bbabf6da787dcc8930385"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad74a18fca945f257dc9d1b99f9edbd40"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ad74a18fca945f257dc9d1b99f9edbd40">RGB_YELLOW</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31, 31,  0)</td></tr>
<tr class="separator:ad74a18fca945f257dc9d1b99f9edbd40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2727da9f8c0b09a67375575a00186e2a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a2727da9f8c0b09a67375575a00186e2a">RGB_DARKYELLOW</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(21, 21,  0)</td></tr>
<tr class="separator:a2727da9f8c0b09a67375575a00186e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ce30ac984869b55594447722b9d0579"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a2ce30ac984869b55594447722b9d0579">RGB_CYAN</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0, 31, 31)</td></tr>
<tr class="separator:a2ce30ac984869b55594447722b9d0579"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4fe0c6cfa46b0c4804425f23bb48f4c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ae4fe0c6cfa46b0c4804425f23bb48f4c">RGB_AQUA</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(28,  5, 22)</td></tr>
<tr class="separator:ae4fe0c6cfa46b0c4804425f23bb48f4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59fb596d3d65cfc4d3cb7e5044b8b10a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a59fb596d3d65cfc4d3cb7e5044b8b10a">RGB_PINK</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31,  0, 31)</td></tr>
<tr class="separator:a59fb596d3d65cfc4d3cb7e5044b8b10a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d5a5f880df6bd4b64e6546839d41101"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a9d5a5f880df6bd4b64e6546839d41101">RGB_PURPLE</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(21,  0, 21)</td></tr>
<tr class="separator:a9d5a5f880df6bd4b64e6546839d41101"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae168f0f9864d4ed4be7807b9783f17f1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ae168f0f9864d4ed4be7807b9783f17f1">RGB_BLACK</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0,  0,  0)</td></tr>
<tr class="separator:ae168f0f9864d4ed4be7807b9783f17f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29b47e2361025eabcdc3bcbff2308044"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a29b47e2361025eabcdc3bcbff2308044">RGB_DARKGRAY</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(10, 10, 10)</td></tr>
<tr class="separator:a29b47e2361025eabcdc3bcbff2308044"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80efbf7b13421922fb174f3e6a3e235c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a80efbf7b13421922fb174f3e6a3e235c">RGB_LIGHTGRAY</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(21, 21, 21)</td></tr>
<tr class="separator:a80efbf7b13421922fb174f3e6a3e235c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1771f95d9887118764bd8a074e537e1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#ac1771f95d9887118764bd8a074e537e1">RGB_WHITE</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31, 31, 31)</td></tr>
<tr class="separator:ac1771f95d9887118764bd8a074e537e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90ef6e9a3d95516b1fef15076b1b4999"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a90ef6e9a3d95516b1fef15076b1b4999">RGB_LIGHTFLESH</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(30, 20, 15)</td></tr>
<tr class="separator:a90ef6e9a3d95516b1fef15076b1b4999"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c2a437dfb89d663a1c2f0a7a9256474"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a7c2a437dfb89d663a1c2f0a7a9256474">RGB_BROWN</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(10, 10,  0)</td></tr>
<tr class="separator:a7c2a437dfb89d663a1c2f0a7a9256474"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a85d8d0da8edc5cce98f48701f903f7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a0a85d8d0da8edc5cce98f48701f903f7">RGB_ORANGE</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(30, 20,  0)</td></tr>
<tr class="separator:a0a85d8d0da8edc5cce98f48701f903f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c8c3710151b2258ea8269850498703f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a9c8c3710151b2258ea8269850498703f">RGB_TEAL</a>&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(15, 15,  0)</td></tr>
<tr class="separator:a9c8c3710151b2258ea8269850498703f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:af868d7cdbd052c6b972ef137e02f6495"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a></td></tr>
<tr class="separator:af868d7cdbd052c6b972ef137e02f6495"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a11902cb1c4de48a1992f5cd595c1da38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> first_palette, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> nb_palettes, const <a class="el" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *rgb_data) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></td></tr>
<tr class="separator:a11902cb1c4de48a1992f5cd595c1da38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70244637bddfbb327c9684455fa8ffa6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> first_palette, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> nb_palettes, const <a class="el" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *rgb_data) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></td></tr>
<tr class="separator:a70244637bddfbb327c9684455fa8ffa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8881ff123f364f2e7d1e88c18f9fbca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">set_bkg_palette_entry</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> palette, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> entry, <a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> rgb_data) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></td></tr>
<tr class="separator:aa8881ff123f364f2e7d1e88c18f9fbca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebeb7431ebd400baed34796a8f50ea58"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">set_sprite_palette_entry</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> palette, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> entry, <a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> rgb_data) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></td></tr>
<tr class="separator:aebeb7431ebd400baed34796a8f50ea58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a476d06d0fe64d7c5a1ec05b8ee859a56"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a476d06d0fe64d7c5a1ec05b8ee859a56">cpu_slow</a> (void)</td></tr>
<tr class="separator:a476d06d0fe64d7c5a1ec05b8ee859a56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a871b5b1aba74ab8764f72b73bc090adb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a871b5b1aba74ab8764f72b73bc090adb">cpu_fast</a> (void)</td></tr>
<tr class="separator:a871b5b1aba74ab8764f72b73bc090adb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a89f4110072dbe76805e7b07299788d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a2a89f4110072dbe76805e7b07299788d">set_default_palette</a> (void)</td></tr>
<tr class="separator:a2a89f4110072dbe76805e7b07299788d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b334e5e452d0650aded17199be1514a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cgb_8h.html#a6b334e5e452d0650aded17199be1514a">cgb_compatibility</a> (void)</td></tr>
<tr class="separator:a6b334e5e452d0650aded17199be1514a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Support for the Color GameBoy (CGB).</p>
<p><b>Enabling CGB features</b></p>
<p>To unlock and use CGB features and registers you need to change byte 0143h in the cartridge header. Otherwise, the CGB will operate in monochrome "Non CGB" compatibility mode. </p><ul>
<li>Use a value of <b>80h</b> for games that support CGB and monochrome gameboys <br  />
 (with Lcc: <b>-Wm-yc</b>, or makebin directly: <b>-yc</b>) </li>
<li>Use a value of <b>C0h</b> for CGB only games. <br  />
 (with Lcc: <b>-Wm-yC</b>, or makebin directly: <b>-yC</b>)</li>
</ul>
<p>See the Pan Docs for more information CGB features. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a4a118ad3ee36468a3fa616977a64864e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a118ad3ee36468a3fa616977a64864e">&#9670;&nbsp;</a></span>RGB</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)((((<a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>) &amp; 0x1f) &lt;&lt; 10) | ((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)(((g) &amp; 0x1f) &lt;&lt; 5)) | ((r) &amp; 0x1f)))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro to create a CGB palette color entry out of 5-bit color components.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>5-bit Red Component, range 0 - 31 (31 brightest) </td></tr>
    <tr><td class="paramname">g</td><td>5-bit Green Component, range 0 - 31 (31 brightest) </td></tr>
    <tr><td class="paramname">b</td><td>5-bit Blue Component, range 0 - 31 (31 brightest)</td></tr>
  </table>
  </dd>
</dl>
<p>The resulting format is bitpacked BGR-555 in a uint16_t.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette()</a>, <a class="el" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette()</a>, <a class="el" href="cgb_8h.html#a7d2ed0f10b2b74123a544327bbfd7564">RGB8()</a>, <a class="el" href="cgb_8h.html#ab5a6e450fcf10402278fe585a421dbbd">RGBHTML()</a> </dd></dl>

</div>
</div>
<a id="a7d2ed0f10b2b74123a544327bbfd7564"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d2ed0f10b2b74123a544327bbfd7564">&#9670;&nbsp;</a></span>RGB8</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB8</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)((((<a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 10)) | ((<a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>)((((g) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 5)) | (((r) &gt;&gt; 3) &amp; 0x1f))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro to create a CGB palette color entry out of 8-bit color components.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>8-bit Red Component, range 0 - 255 (255 brightest) </td></tr>
    <tr><td class="paramname">g</td><td>8-bit Green Component, range 0 - 255 (255 brightest) </td></tr>
    <tr><td class="paramname">b</td><td>8-bit Blue Component, range 0 - 255 (255 brightest)</td></tr>
  </table>
  </dd>
</dl>
<p>The resulting format is bitpacked BGR-555 in a uint16_t.</p>
<p>The lowest 3 bits of each color component are dropped during conversion.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette()</a>, <a class="el" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette()</a>, <a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB()</a>, <a class="el" href="cgb_8h.html#ab5a6e450fcf10402278fe585a421dbbd">RGBHTML()</a> </dd></dl>

</div>
</div>
<a id="ab5a6e450fcf10402278fe585a421dbbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5a6e450fcf10402278fe585a421dbbd">&#9670;&nbsp;</a></span>RGBHTML</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGBHTML</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">RGB24bit</td><td>)</td>
          <td>&#160;&#160;&#160;(<a class="el" href="nes_8h.html#a7d2ed0f10b2b74123a544327bbfd7564">RGB8</a>((((RGB24bit) &gt;&gt; 16) &amp; 0xff), (((RGB24bit) &gt;&gt; 8) &amp; 0xff), ((RGB24bit) &amp; 0xff)))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro to convert a 24 Bit RGB color to a CGB palette color entry.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">RGB24bit</td><td>Bit packed RGB-888 color (0-255 for each color component).</td></tr>
  </table>
  </dd>
</dl>
<p>The resulting format is bitpacked BGR-555 in a uint16_t.</p>
<p>The lowest 3 bits of each color component are dropped during conversion.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette()</a>, <a class="el" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette()</a>, <a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB()</a>, <a class="el" href="cgb_8h.html#a7d2ed0f10b2b74123a544327bbfd7564">RGB8()</a> </dd></dl>

</div>
</div>
<a id="aa039288455af8a3812a35aa1e7b903e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa039288455af8a3812a35aa1e7b903e4">&#9670;&nbsp;</a></span>RGB_RED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_RED&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31,  0,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Common colors based on the EGA default palette. </p>

</div>
</div>
<a id="ae29b6947ac7dca7db513e59f1cfcbf51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae29b6947ac7dca7db513e59f1cfcbf51">&#9670;&nbsp;</a></span>RGB_DARKRED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_DARKRED&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(15,  0,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ab6c97468034c02fe204fd37036d9be15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6c97468034c02fe204fd37036d9be15">&#9670;&nbsp;</a></span>RGB_GREEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_GREEN&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0, 31,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a1ee7a5d8fd635e9132a2820a60f9789d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ee7a5d8fd635e9132a2820a60f9789d">&#9670;&nbsp;</a></span>RGB_DARKGREEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_DARKGREEN&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0, 15,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0eff802f1ca228046476209dc01c76ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0eff802f1ca228046476209dc01c76ad">&#9670;&nbsp;</a></span>RGB_BLUE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_BLUE&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0,  0, 31)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad44385fc245bbabf6da787dcc8930385"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad44385fc245bbabf6da787dcc8930385">&#9670;&nbsp;</a></span>RGB_DARKBLUE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_DARKBLUE&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0,  0, 15)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad74a18fca945f257dc9d1b99f9edbd40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad74a18fca945f257dc9d1b99f9edbd40">&#9670;&nbsp;</a></span>RGB_YELLOW</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_YELLOW&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31, 31,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a2727da9f8c0b09a67375575a00186e2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2727da9f8c0b09a67375575a00186e2a">&#9670;&nbsp;</a></span>RGB_DARKYELLOW</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_DARKYELLOW&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(21, 21,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a2ce30ac984869b55594447722b9d0579"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ce30ac984869b55594447722b9d0579">&#9670;&nbsp;</a></span>RGB_CYAN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_CYAN&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0, 31, 31)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ae4fe0c6cfa46b0c4804425f23bb48f4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4fe0c6cfa46b0c4804425f23bb48f4c">&#9670;&nbsp;</a></span>RGB_AQUA</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_AQUA&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(28,  5, 22)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a59fb596d3d65cfc4d3cb7e5044b8b10a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59fb596d3d65cfc4d3cb7e5044b8b10a">&#9670;&nbsp;</a></span>RGB_PINK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_PINK&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31,  0, 31)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a9d5a5f880df6bd4b64e6546839d41101"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d5a5f880df6bd4b64e6546839d41101">&#9670;&nbsp;</a></span>RGB_PURPLE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_PURPLE&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(21,  0, 21)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ae168f0f9864d4ed4be7807b9783f17f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae168f0f9864d4ed4be7807b9783f17f1">&#9670;&nbsp;</a></span>RGB_BLACK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_BLACK&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>( 0,  0,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a29b47e2361025eabcdc3bcbff2308044"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29b47e2361025eabcdc3bcbff2308044">&#9670;&nbsp;</a></span>RGB_DARKGRAY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_DARKGRAY&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(10, 10, 10)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a80efbf7b13421922fb174f3e6a3e235c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80efbf7b13421922fb174f3e6a3e235c">&#9670;&nbsp;</a></span>RGB_LIGHTGRAY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_LIGHTGRAY&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(21, 21, 21)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ac1771f95d9887118764bd8a074e537e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1771f95d9887118764bd8a074e537e1">&#9670;&nbsp;</a></span>RGB_WHITE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_WHITE&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(31, 31, 31)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a90ef6e9a3d95516b1fef15076b1b4999"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90ef6e9a3d95516b1fef15076b1b4999">&#9670;&nbsp;</a></span>RGB_LIGHTFLESH</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_LIGHTFLESH&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(30, 20, 15)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a7c2a437dfb89d663a1c2f0a7a9256474"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c2a437dfb89d663a1c2f0a7a9256474">&#9670;&nbsp;</a></span>RGB_BROWN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_BROWN&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(10, 10,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0a85d8d0da8edc5cce98f48701f903f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a85d8d0da8edc5cce98f48701f903f7">&#9670;&nbsp;</a></span>RGB_ORANGE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_ORANGE&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(30, 20,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a9c8c3710151b2258ea8269850498703f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c8c3710151b2258ea8269850498703f">&#9670;&nbsp;</a></span>RGB_TEAL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RGB_TEAL&#160;&#160;&#160;<a class="el" href="nes_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB</a>(15, 15,  0)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="af868d7cdbd052c6b972ef137e02f6495"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af868d7cdbd052c6b972ef137e02f6495">&#9670;&nbsp;</a></span>palette_color_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> <a class="el" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>16 bit color entry </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a11902cb1c4de48a1992f5cd595c1da38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a11902cb1c4de48a1992f5cd595c1da38">&#9670;&nbsp;</a></span>set_bkg_palette()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void set_bkg_palette </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>first_palette</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>nb_palettes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *&#160;</td>
          <td class="paramname"><em>rgb_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set CGB background palette(s).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">first_palette</td><td>Index of the first palette to write (0-7) </td></tr>
    <tr><td class="paramname">nb_palettes</td><td>Number of palettes to write (1-8, max depends on first_palette) </td></tr>
    <tr><td class="paramname">rgb_data</td><td>Pointer to source palette data</td></tr>
  </table>
  </dd>
</dl>
<p>Writes <b>nb_palettes</b> to background palette data starting at <b>first_palette</b>, Palette data is sourced from <b>rgb_data</b>.</p>
<ul>
<li>Each Palette is 8 bytes in size: 4 colors x 2 bytes per palette color entry. </li>
<li>Each color (4 per palette) is packed as BGR-555 format (1:5:5:5, MSBit [15] is unused). </li>
<li>Each component (R, G, B) may have values from 0 - 31 (5 bits), 31 is brightest.</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB()</a>, <a class="el" href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">set_bkg_palette_entry()</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#a4a771645b1215477023c89c8ea7e939d">BKGF_CGB_PAL0</a>, <a class="el" href="gb_2hardware_8h.html#a55225c84026779ae4596ceb319e2f111">BKGF_CGB_PAL1</a>, <a class="el" href="gb_2hardware_8h.html#af3ccbb599ddbe72ce3e5e7f82552ceb1">BKGF_CGB_PAL2</a>, <a class="el" href="gb_2hardware_8h.html#a1ee798f12c60156325284722d9a1a15a">BKGF_CGB_PAL3</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#adb3a50ad5e3fc54bf332e4156c218e2b">BKGF_CGB_PAL4</a>, <a class="el" href="gb_2hardware_8h.html#a458910105b4cd6c2f84e8a658d1a5c86">BKGF_CGB_PAL5</a>, <a class="el" href="gb_2hardware_8h.html#a563317d0bc48caf19a0ffe15100ca7fd">BKGF_CGB_PAL6</a>, <a class="el" href="gb_2hardware_8h.html#a7966b3d048fb1f1e348cc17f81fd5b04">BKGF_CGB_PAL7</a> </dd></dl>

</div>
</div>
<a id="a70244637bddfbb327c9684455fa8ffa6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70244637bddfbb327c9684455fa8ffa6">&#9670;&nbsp;</a></span>set_sprite_palette()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void set_sprite_palette </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>first_palette</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>nb_palettes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *&#160;</td>
          <td class="paramname"><em>rgb_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set CGB sprite palette(s).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">first_palette</td><td>Index of the first palette to write (0-7) </td></tr>
    <tr><td class="paramname">nb_palettes</td><td>Number of palettes to write (1-8, max depends on first_palette) </td></tr>
    <tr><td class="paramname">rgb_data</td><td>Pointer to source palette data</td></tr>
  </table>
  </dd>
</dl>
<p>Writes <b>nb_palettes</b> to sprite palette data starting at <b>first_palette</b>, Palette data is sourced from <b>rgb_data</b>.</p>
<ul>
<li>Each Palette is 8 bytes in size: 4 colors x 2 bytes per palette color entry. </li>
<li>Each color (4 per palette) is packed as BGR-555 format (1:5:5:5, MSBit [15] is unused). </li>
<li>Each component (R, G, B) may have values from 0 - 31 (5 bits), 31 is brightest.</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB()</a>, <a class="el" href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">set_sprite_palette_entry()</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#a4ff8c8a7acb74ba54043596110091605">OAMF_CGB_PAL0</a>, <a class="el" href="gb_2hardware_8h.html#a9dff52d03755812d3a5ee7ca971c2e83">OAMF_CGB_PAL1</a>, <a class="el" href="gb_2hardware_8h.html#a74744fb475532fa5d343e0818dcc6f88">OAMF_CGB_PAL2</a>, <a class="el" href="gb_2hardware_8h.html#a704ab20694793ea87aace8bfc29568bc">OAMF_CGB_PAL3</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#a13d5cddfb4a05fa49fc794aeea675c7b">OAMF_CGB_PAL4</a>, <a class="el" href="gb_2hardware_8h.html#af9284c71b8ebf10ef8b9e12268f2cce3">OAMF_CGB_PAL5</a>, <a class="el" href="gb_2hardware_8h.html#ad6f5b0d9ae958dee3d6dfa8f4273ff5a">OAMF_CGB_PAL6</a>, <a class="el" href="gb_2hardware_8h.html#af4b27e8f3c3e14a4f91051fea4c64e4b">OAMF_CGB_PAL7</a> </dd></dl>

</div>
</div>
<a id="aa8881ff123f364f2e7d1e88c18f9fbca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8881ff123f364f2e7d1e88c18f9fbca">&#9670;&nbsp;</a></span>set_bkg_palette_entry()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void set_bkg_palette_entry </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>palette</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>entry</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>&#160;</td>
          <td class="paramname"><em>rgb_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets a single color in the specified CGB background palette.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">palette</td><td>Index of the palette to modify (0-7) </td></tr>
    <tr><td class="paramname">entry</td><td>Index of color in palette to modify (0-3) </td></tr>
    <tr><td class="paramname">rgb_data</td><td>New color data in BGR 15bpp format.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette()</a>, <a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB()</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#a4a771645b1215477023c89c8ea7e939d">BKGF_CGB_PAL0</a>, <a class="el" href="gb_2hardware_8h.html#a55225c84026779ae4596ceb319e2f111">BKGF_CGB_PAL1</a>, <a class="el" href="gb_2hardware_8h.html#af3ccbb599ddbe72ce3e5e7f82552ceb1">BKGF_CGB_PAL2</a>, <a class="el" href="gb_2hardware_8h.html#a1ee798f12c60156325284722d9a1a15a">BKGF_CGB_PAL3</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#adb3a50ad5e3fc54bf332e4156c218e2b">BKGF_CGB_PAL4</a>, <a class="el" href="gb_2hardware_8h.html#a458910105b4cd6c2f84e8a658d1a5c86">BKGF_CGB_PAL5</a>, <a class="el" href="gb_2hardware_8h.html#a563317d0bc48caf19a0ffe15100ca7fd">BKGF_CGB_PAL6</a>, <a class="el" href="gb_2hardware_8h.html#a7966b3d048fb1f1e348cc17f81fd5b04">BKGF_CGB_PAL7</a> </dd></dl>

</div>
</div>
<a id="aebeb7431ebd400baed34796a8f50ea58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebeb7431ebd400baed34796a8f50ea58">&#9670;&nbsp;</a></span>set_sprite_palette_entry()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void set_sprite_palette_entry </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>palette</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>entry</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a>&#160;</td>
          <td class="paramname"><em>rgb_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets a single color in the specified CGB sprite palette.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">palette</td><td>Index of the palette to modify (0-7) </td></tr>
    <tr><td class="paramname">entry</td><td>Index of color in palette to modify (0-3) </td></tr>
    <tr><td class="paramname">rgb_data</td><td>New color data in BGR 15bpp format.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette()</a>, <a class="el" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">RGB()</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#a4ff8c8a7acb74ba54043596110091605">OAMF_CGB_PAL0</a>, <a class="el" href="gb_2hardware_8h.html#a9dff52d03755812d3a5ee7ca971c2e83">OAMF_CGB_PAL1</a>, <a class="el" href="gb_2hardware_8h.html#a74744fb475532fa5d343e0818dcc6f88">OAMF_CGB_PAL2</a>, <a class="el" href="gb_2hardware_8h.html#a704ab20694793ea87aace8bfc29568bc">OAMF_CGB_PAL3</a> </dd>
<dd>
<a class="el" href="gb_2hardware_8h.html#a13d5cddfb4a05fa49fc794aeea675c7b">OAMF_CGB_PAL4</a>, <a class="el" href="gb_2hardware_8h.html#af9284c71b8ebf10ef8b9e12268f2cce3">OAMF_CGB_PAL5</a>, <a class="el" href="gb_2hardware_8h.html#ad6f5b0d9ae958dee3d6dfa8f4273ff5a">OAMF_CGB_PAL6</a>, <a class="el" href="gb_2hardware_8h.html#af4b27e8f3c3e14a4f91051fea4c64e4b">OAMF_CGB_PAL7</a> </dd></dl>

</div>
</div>
<a id="a476d06d0fe64d7c5a1ec05b8ee859a56"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a476d06d0fe64d7c5a1ec05b8ee859a56">&#9670;&nbsp;</a></span>cpu_slow()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cpu_slow </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set CPU speed to slow (Normal Speed) operation.</p>
<p>Interrupts are temporarily disabled and then re-enabled during this call.</p>
<p>In this mode the CGB operates at the same speed as the DMG/Pocket/SGB models.</p>
<ul>
<li>You can check to see if <a class="el" href="gb_8h.html#a874b9bd95b0a05d6a6072feabc879e45">_cpu</a> == <a class="el" href="gb_8h.html#aee435a3a0dde3dbd7b6112dbb456cde8">CGB_TYPE</a> before using this function.</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a871b5b1aba74ab8764f72b73bc090adb">cpu_fast()</a> </dd></dl>

</div>
</div>
<a id="a871b5b1aba74ab8764f72b73bc090adb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a871b5b1aba74ab8764f72b73bc090adb">&#9670;&nbsp;</a></span>cpu_fast()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void cpu_fast </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Set CPU speed to fast (CGB Double Speed) operation.</p>
<p>On startup the CGB operates in Normal Speed Mode and can be switched into Double speed mode (faster processing but also higher power consumption). See the Pan Docs for more information about which hardware features operate faster and which remain at Normal Speed.</p>
<ul>
<li>Interrupts are temporarily disabled and then re-enabled during this call. </li>
<li>You can check to see if <a class="el" href="gb_8h.html#a874b9bd95b0a05d6a6072feabc879e45">_cpu</a> == <a class="el" href="gb_8h.html#aee435a3a0dde3dbd7b6112dbb456cde8">CGB_TYPE</a> before using this function.</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="cgb_8h.html#a476d06d0fe64d7c5a1ec05b8ee859a56">cpu_slow()</a>, <a class="el" href="gb_8h.html#a874b9bd95b0a05d6a6072feabc879e45">_cpu</a> </dd></dl>

</div>
</div>
<a id="a2a89f4110072dbe76805e7b07299788d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a89f4110072dbe76805e7b07299788d">&#9670;&nbsp;</a></span>set_default_palette()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void set_default_palette </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets CGB palette 0 to be compatible with the DMG/GBP.</p>
<p>The default/first CGB palettes for sprites and backgrounds are set to a similar default appearance as on the DMG/Pocket/SGB models. (White, Light Gray, Dark Gray, Black)</p>
<ul>
<li>You can check to see if <a class="el" href="gb_8h.html#a874b9bd95b0a05d6a6072feabc879e45">_cpu</a> == <a class="el" href="gb_8h.html#aee435a3a0dde3dbd7b6112dbb456cde8">CGB_TYPE</a> before using this function. </li>
</ul>

</div>
</div>
<a id="a6b334e5e452d0650aded17199be1514a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b334e5e452d0650aded17199be1514a">&#9670;&nbsp;</a></span>cgb_compatibility()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void cgb_compatibility </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obsolete. This function has been replaced by <a class="el" href="cgb_8h.html#a2a89f4110072dbe76805e7b07299788d">set_default_palette()</a>, which has identical behavior. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
